import request from '../../utils/request';
import deptUrl from '../urls/deptment'


//根据条件获取部门的所有信息
export const fetchDeptData = data => {
  return request({
    url: deptUrl.fetchDeptUrl,
    //url: "./deptdata.json",
    method: 'get',
    params: data
  });
};

//添加部门
export const addDept = data => {
  return request({
    headers: {
      "Content-Type": "application/json"
    },
    url: deptUrl.addDeptUrl,
    method: 'post',
    data: data
  });
};

//更新部门数据
export const updateDeptData = data => {
  return request({
    headers: {
      "Content-Type": "application/json"
    },
    url: deptUrl.updateDeptUrl,
    method: 'post',
    data: data
  });
};

//根据id删除部门数据
export const deleteDeptById = data => {
  return request({
    url: deptUrl.deleteDeptUrl,
    method: 'get',
    params: data
  });
};

//获取所有部门的id和名称
export const getDeptIdAndName = () => {
  return request({
    url: deptUrl.getIdAndNameUrl,
    method: 'get',
  });
};

//统计各个部门的学历情况
export  const  countDeptEdu = () => {
  return request({
    url: deptUrl.countDeptEduUrl,
    method: 'get',
  });
};

    
    